package com.zzc.legou.security.security.controller;


import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class TestEndPointController {

    @GetMapping("/product/{id}")
    public String getProduct(@PathVariable String id) {
        return "product id : " + id;
    }

    @GetMapping("/order/{id}")
    public String getOrder(@PathVariable String id) {
        return "order id : " + id;
    }

    @GetMapping("/book/{id}")
    public String getBook(@PathVariable String id) {
        return "book id : " + id;
    }

//    @GetMapping("/getPrinciple")
//    public OAuth2Authentication getPrinciple(OAuth2Authentication oAuth2Authentication, Principal principal, Authentication authentication) {
//        log.info(oAuth2Authentication.getUserAuthentication().getAuthorities().toString());
//        log.info(oAuth2Authentication.toString());
//        log.info("principal.toString() " + principal.toString());
//        log.info("principal.getName() " + principal.getName());
//        log.info("authentication: " + authentication.getAuthorities().toString());
//
//        return oAuth2Authentication;
//    }

}